package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zywork.dao.GoodsCollectionDAO;
import top.zywork.dos.GoodsCollectionDO;
import top.zywork.dto.GoodsCollectionDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.GoodsCollectionService;

import javax.annotation.PostConstruct;

/**
 * GoodsCollectionServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-07-24<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsCollectionService")
public class GoodsCollectionServiceImpl extends AbstractBaseService implements GoodsCollectionService {

    private GoodsCollectionDAO goodsCollectionDAO;

    @Autowired
    public void setGoodsCollectionDAO(GoodsCollectionDAO goodsCollectionDAO) {
        super.setBaseDAO(goodsCollectionDAO);
        this.goodsCollectionDAO = goodsCollectionDAO;
    }

    @PostConstruct
    public void init() {
        super.init(GoodsCollectionDO.class, GoodsCollectionDTO.class);
    }

    @Override
    public Long cancelCollection(Long userId, Long goodsId, Long goodsSkuId, Long shopId) {
        return goodsCollectionDAO.cancelCollection(userId, goodsId, goodsSkuId, shopId);
    }
}
